﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Microsoft.Reporting.WebForms;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using trangbaocao.Models;

namespace trangbaocao.Reports.Manufactorys
{
    public partial class ReportNsx : System.Web.UI.Page 
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                  

                ReportViewer1.Reset();
                ManufactorysModel ManufactorysModel = new ManufactorysModel();
                List<ManufactorysModel> manufactorys = ManufactorysModel.getNhasanxuat();
                ReportViewer1.LocalReport.ReportPath = "Reports/Manufactorys/List_Manufactorys/Manufactorys.rdlc";
                ReportViewer1.LocalReport.DataSources.Clear();
                ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("Manufactorys_DS", manufactorys));

                ReportViewer1.DataBind();
                ReportViewer1.LocalReport.Refresh();
                    
                
            }
        }

        //protected void Button1_Click(object sender, EventArgs e)
        //{
        //    trangbaocao.Models.ReportPrintDocument rd = new trangbaocao.Models.ReportPrintDocument();
        //    rd.Export(ReportViewer1.LocalReport);            
        //    rd.Print();
        //}        
        
         
    }
}